package fr.ordre66.vlcs.ws;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import fr.ordre66.vlcs.dto.User;
import fr.ordre66.vlcs.services.IUserManager;

@Path("users")
@Service("userWs")
public class UserWs {

	@Autowired IUserManager userManager;
	
	
	@GET
	@Path("/")
	@Produces(MediaType.TEXT_XML)
	public List<User> getAll(){
		System.out.println("Methode GET ALL");
		return userManager.getAll();
	}
	
	@GET
	@Path("{login}")
	@Produces(MediaType.TEXT_XML)
	public User getHelloWorld(@PathParam("login") String login) {
		System.out.println("Methode GET");
		return userManager.get(login);
	}
}
